package com.powernode.myspring.bean.factory.method;

// 客户端程序
public class Test {
    public static void main(String[] args) {
        WeaponFactory weaponFactory = new DaggerFactory();
        Weapon dagger = weaponFactory.get();
        dagger.attack();

        WeaponFactory weaponFactory1 = new GunFactory();
        Weapon gun = weaponFactory1.get();
        gun.attack();

        WeaponFactory weaponFactory2 = new FighterFactory();
        Weapon fighter = weaponFactory2.get();
        fighter.attack();
    }
}
